package com.ruoyi.dgw.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.dgw.mapper.TreatmentMapper;
import com.ruoyi.dgw.domain.Treatment;
import com.ruoyi.dgw.service.ITreatmentService;

/**
 * 无危化处理Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-11-30
 */
@Service
public class TreatmentServiceImpl implements ITreatmentService 
{
    @Autowired
    private TreatmentMapper treatmentMapper;

    /**
     * 查询无危化处理
     * 
     * @param id 无危化处理主键
     * @return 无危化处理
     */
    @Override
    public Treatment selectTreatmentById(Long id)
    {
        return treatmentMapper.selectTreatmentById(id);
    }

    /**
     * 查询无危化处理列表
     * 
     * @param treatment 无危化处理
     * @return 无危化处理
     */
    @Override
    public List<Treatment> selectTreatmentList(Treatment treatment)
    {
        return treatmentMapper.selectTreatmentList(treatment);
    }

    /**
     * 新增无危化处理
     * 
     * @param treatment 无危化处理
     * @return 结果
     */
    @Override
    public int insertTreatment(Treatment treatment)
    {
        treatment.setCreateTime(DateUtils.getNowDate());
        return treatmentMapper.insertTreatment(treatment);
    }

    /**
     * 修改无危化处理
     * 
     * @param treatment 无危化处理
     * @return 结果
     */
    @Override
    public int updateTreatment(Treatment treatment)
    {
        treatment.setUpdateTime(DateUtils.getNowDate());
        return treatmentMapper.updateTreatment(treatment);
    }

    /**
     * 批量删除无危化处理
     * 
     * @param ids 需要删除的无危化处理主键
     * @return 结果
     */
    @Override
    public int deleteTreatmentByIds(Long[] ids)
    {
        return treatmentMapper.deleteTreatmentByIds(ids);
    }

    /**
     * 删除无危化处理信息
     * 
     * @param id 无危化处理主键
     * @return 结果
     */
    @Override
    public int deleteTreatmentById(Long id)
    {
        return treatmentMapper.deleteTreatmentById(id);
    }
}
